<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 获取时间戳，并转化输出格式类似：2012-12-1 13:00:00 35 -->
    <script>
        var datre = new Date();
        console.log(datre);
        var time = datre.getFullYear() + "-" + (datre.getMonth() + 1) + "-" + datre.getDate() + "   " + datre.getHours() + ":" +
        datre.getMinutes() + ":" + datre.getSeconds() + "  " + datre.getTime();
        console.log(time);
    </script>
</body>
</html>